package daytwo.while循环;

import java.util.Scanner;

/*
练习：**从键盘输入整数，输入0结束，统计输入的正数、负数的个数
 */
public class pra6 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int zheng = 0;
        int fu = 0;
        int num = 1;
        while (num != 0) {
            System.out.println("请输入一个整数（0代表结束）");
            num = sc.nextInt();
            if (num > 0) {
                zheng++;
            } else if (num < 0) {
                fu++;
            }
        }
        System.out.println("正数个数" + zheng);
        System.out.println("负数个数" + fu);

    }
}
